import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class DD {

    public void getdiStricts() {
        String string = "昆都仑区,东河区,青山区,石拐区,白云鄂博矿区,九原区,固阳县,土默特右旗,达尔罕茂明安联合旗";
        String[] strings = string.split(",");
        for (int i=0;i<strings.length;i++) {
            System.out.println("INSERT INTO new_database.dbo.tb_districts_table (county_number, name_of_counties) VALUES (" + i + ",\'" + strings[i] + "\');");
        }
    }


    public void getUser() {
        String string = "王帅霖\t15540250617\n" +
                "贝伟富\t18718991930\n" +
                "石昌青\t13224873411\n" +
                "刘晓慧\t13674871479\n" +
                "王鹏\t15849470743\n" +
                "任鸿飞\t15849479152\n" +
                "孟庆宁\t13224851023\n" +
                "王杨\t13284710904\n" +
                "陈杰\t13224712134\n" +
                "马国俊\t13224871238\n" +
                "郝夙瑶\t15540256397\n" +
                "秦宇航\t15661392213\n" +
                "董旺\t13224717163\n" +
                "张冲\t15248560925\n" +
                "孙海博\t15991367032\n" +
                "蒋利智\t13224871354\n" +
                "张国强\t15848676760\n" +
                "卢志皓\t15849478466\n" +
                "曹宝宝\t15849465079\n" +
                "刘鹏\t15048443876\n" +
                "白雄\t14747272897\n" +
                "邓浩均\t15849476712\n" +
                "刘源\t13224724635\n" +
                "李国强\t15849475904\n" +
                "郭威\t13224858536\n" +
                "李荣京\t17614820740\n" +
                "卢良臣\t18586165452\n" +
                "王维坤\t13224859533\n" +
                "王晓宇\t15247468059\n" +
                "郎海霞\t15848672258\n" +
                "赵东旭\t18547276414\n" +
                "王悦琦\t17604893590\n" +
                "龚倩\t15661663018\n" +
                "戴祥\t13224710933\n" +
                "黄鑫烨\t13511710924\n" +
                "高家奇\t18586100016\n" +
                "王晓晖\t13224858382\n" +
                "白晓龙\t13224722245\n" +
                "李松吉\t13224869432\n" +
                "高伟\t15661666339\n" +
                "张小旭\t13642094644\n" +
                "董广跃\t15848663411\n" +
                "周齐\t15661561240\n" +
                "贾翔宇\t15548125401\n" +
                "卢宏铭\t13224714389\n" +
                "郭之曦\t15849745140\n";
        String[] strings = string.split("\n");
        int number = strings.length;
        int j=0;
        for (int i=46;i<2000;i++) {
            String[] str = strings[j].split("\t");
            String strI = str[0];
            String strII = str[1];
            j++;
            if (j == 45) {
                j = 0;
            }
            System.out.println("INSERT INTO new_database.dbo.tb_customer_table" +
                    "(customer_number, customer_name, customer_password, " +
                    "customer_registration_date, customer_contact_information) " +
                    "VALUES (" + i + ", \'" + strI + "\', \'" + strII + "\', " + "GEtDATE(), \'" + strII + "\');");
        }
    }

    public void getStreet() {
        String string = "少先路街道\t1\n" +
                "沼潭街道\t1\n" +
                "林荫路街道\t1\n" +
                "友谊大街街道\t1\n" +
                "阿尔丁大街街道\t1\n" +
                "富强路街道\t2\n" +
                "幸福路街道\t2\n" +
                "青山路街道\t2\n" +
                "自由路街道\t2\n" +
                "万青路街道\t2\n" +
                "铁西街道\t3\n" +
                "西脑包街道\t3\n" +
                "财神庙街道\t3\n" +
                "东站街道\t3\n" +
                "沙河街道\t4\n" +
                "赛汉街道\t4\n" +
                "萨如拉街道\t4\n" +
                "石拐街道\t5\n" +
                "大发街道\t5\n" +
                "通阳路街道\t6\n" +
                "矿山路街道\t6";
        String[] strings = string.split("\n");
        for (int i=0;i<21;i++) {
            //System.out.println(strings[i]);
            String[] str = strings[i].split("\t");
            String strI = str[0];
            String strII = str[1];

            System.out.println("INSERT INTO new_database.dbo.tb_street_table " +
                    "(street_number, street_name, county_number) " +
                    "VALUES (" + i + ", \'" + strI + "\', \'" + strII + "\')");

        }

    }

    public void getRentalHousing() {
        //
        String string = "挥泪出租 出租房大甩卖 大力出租 出租 便宜出租 好房源出租 出租房屋";

        String[] strings = string.split(" ");
        int longth = strings.length;

        Random ra =new Random();

        String sql = "INSERT INTO new_database.dbo.tb_rental_housing_table (rental_house_number, customer_number, house_type_number, rent, title, description, date, notes, rented_it) VALUES ();";

        int user_id = 0;
        int home_type = 0;
        int rent = 0;

        int y = 0;
        int m = 0;
        int d = 0;
        int j = 0;

        String data = null;
        for (int i=2000;i<3000;i++) {
            //随机用户
            user_id = ra.nextInt(1997)+1;
            //随机房屋类型
            home_type = ra.nextInt(47) + 1;
            //随机租金
            rent = ra.nextInt(50) * 10 + 1500;
            //随机年
            y = ra.nextInt(5) + 2013;
            //随机月
            m = ra.nextInt(12) + 1;
            //随机日
            d = ra.nextInt(28) + 1;
            data = y + "-" + m + "-" + d ;

            j = ra.nextInt(6) + 1;

            System.out.println("INSERT INTO new_database.dbo.tb_rental_housing_table " +
                    "(rental_house_number, customer_number, house_type_number," +
                    " rent, title, description, date, notes, rented_it) " +
                    "VALUES (" + i + ", " + user_id + ", " + home_type + "," +
                    rent + ", \'" + strings[j] + "\', \'" + "房价便宜" + "\', \'" + data + "\', \'"
                    + "没有备注！\'," + 0 +");");

        }



    }

    public void getOrder() {
        String string = "0\n" +
                "4\n" +
                "9\n" +
                "17\n" +
                "20\n" +
                "27\n" +
                "32\n" +
                "43\n" +
                "46\n" +
                "58\n" +
                "64\n" +
                "66\n" +
                "69\n" +
                "70\n" +
                "76\n" +
                "77\n" +
                "78\n" +
                "79\n" +
                "85\n" +
                "88\n" +
                "94\n" +
                "98\n" +
                "101\n" +
                "106\n" +
                "111\n" +
                "118\n" +
                "126\n" +
                "134\n" +
                "137\n" +
                "143\n" +
                "144\n" +
                "147\n" +
                "149\n" +
                "150\n" +
                "151\n" +
                "154\n" +
                "155\n" +
                "158\n" +
                "159\n" +
                "162\n" +
                "166\n" +
                "169\n" +
                "173\n" +
                "174\n" +
                "178\n" +
                "179\n" +
                "190\n" +
                "197\n" +
                "201\n" +
                "207\n" +
                "208\n" +
                "213\n" +
                "215\n" +
                "224\n" +
                "228\n" +
                "234\n" +
                "235\n" +
                "236\n" +
                "238\n" +
                "240\n" +
                "241\n" +
                "246\n" +
                "251\n" +
                "252\n" +
                "255\n" +
                "261\n" +
                "266\n" +
                "267\n" +
                "280\n" +
                "281\n" +
                "282\n" +
                "283\n" +
                "294\n" +
                "296\n" +
                "297\n" +
                "300\n" +
                "302\n" +
                "304\n" +
                "305\n" +
                "307\n" +
                "308\n" +
                "309\n" +
                "333\n" +
                "334\n" +
                "335\n" +
                "338\n" +
                "340\n" +
                "354\n" +
                "363\n" +
                "371\n" +
                "375\n" +
                "384\n" +
                "386\n" +
                "392\n" +
                "393\n" +
                "396\n" +
                "397\n" +
                "400\n" +
                "402\n" +
                "405\n" +
                "409\n" +
                "421\n" +
                "435\n" +
                "445\n" +
                "446\n" +
                "450\n" +
                "462\n" +
                "469\n" +
                "475\n" +
                "492\n" +
                "501\n" +
                "505\n" +
                "515\n" +
                "516\n" +
                "517\n" +
                "522\n" +
                "523\n" +
                "531\n" +
                "535\n" +
                "540\n" +
                "542\n" +
                "552\n" +
                "553\n" +
                "565\n" +
                "572\n" +
                "574\n" +
                "575\n" +
                "577\n" +
                "578\n" +
                "584\n" +
                "585\n" +
                "592\n" +
                "599\n" +
                "601\n" +
                "604\n" +
                "609\n" +
                "611\n" +
                "612\n" +
                "617\n" +
                "625\n" +
                "636\n" +
                "640\n" +
                "641\n" +
                "642\n" +
                "653\n" +
                "654\n" +
                "658\n" +
                "666\n" +
                "669\n" +
                "670\n" +
                "672\n" +
                "677\n" +
                "680\n" +
                "682\n" +
                "691\n" +
                "693\n" +
                "698\n" +
                "699\n" +
                "700\n" +
                "703\n" +
                "704\n" +
                "706\n" +
                "712\n" +
                "716\n" +
                "721\n" +
                "726\n" +
                "729\n" +
                "731\n" +
                "733\n" +
                "736\n" +
                "741\n" +
                "742\n" +
                "745\n" +
                "750\n" +
                "753\n" +
                "755\n" +
                "757\n" +
                "766\n" +
                "768\n" +
                "770\n" +
                "792\n" +
                "797\n" +
                "801\n" +
                "803\n" +
                "806\n" +
                "807\n" +
                "809\n" +
                "816\n" +
                "817\n" +
                "819\n" +
                "821\n" +
                "822\n" +
                "824\n" +
                "826\n" +
                "828\n" +
                "830\n" +
                "831\n" +
                "835\n" +
                "837\n" +
                "843\n" +
                "844\n" +
                "850\n" +
                "856\n" +
                "865\n" +
                "868\n" +
                "872\n" +
                "873\n" +
                "874\n" +
                "876\n" +
                "877\n" +
                "883\n" +
                "884\n" +
                "891\n" +
                "892\n" +
                "894\n" +
                "898\n" +
                "907\n" +
                "913\n" +
                "916\n" +
                "921\n" +
                "923\n" +
                "932\n" +
                "934\n" +
                "944\n" +
                "945\n" +
                "946\n" +
                "951\n" +
                "954\n" +
                "956\n" +
                "960\n" +
                "961\n" +
                "966\n" +
                "969\n" +
                "971\n" +
                "972\n" +
                "975\n" +
                "976\n" +
                "981\n" +
                "989\n" +
                "994\n" +
                "995\n" +
                "999\n" +
                "1003\n" +
                "1006\n" +
                "1009\n" +
                "1015\n" +
                "1018\n" +
                "1021\n" +
                "1025\n" +
                "1027\n" +
                "1031\n" +
                "1033\n" +
                "1037\n" +
                "1041\n" +
                "1050\n" +
                "1057\n" +
                "1060\n" +
                "1065\n" +
                "1068\n" +
                "1077\n" +
                "1082\n" +
                "1083\n" +
                "1086\n" +
                "1087\n" +
                "1104\n" +
                "1107\n" +
                "1111\n" +
                "1114\n" +
                "1116\n" +
                "1118\n" +
                "1121\n" +
                "1122\n" +
                "1126\n" +
                "1127\n" +
                "1129\n" +
                "1132\n" +
                "1147\n" +
                "1154\n" +
                "1164\n" +
                "1175\n" +
                "1180\n" +
                "1182\n" +
                "1190\n" +
                "1192\n" +
                "1202\n" +
                "1203\n" +
                "1206\n" +
                "1217\n" +
                "1226\n" +
                "1229\n" +
                "1233\n" +
                "1250\n" +
                "1257\n" +
                "1265\n" +
                "1275\n" +
                "1277\n" +
                "1288\n" +
                "1291\n" +
                "1307\n" +
                "1313\n" +
                "1315\n" +
                "1316\n" +
                "1318\n" +
                "1319\n" +
                "1322\n" +
                "1325\n" +
                "1327\n" +
                "1333\n" +
                "1334\n" +
                "1339\n" +
                "1341\n" +
                "1344\n" +
                "1345\n" +
                "1346\n" +
                "1347\n" +
                "1362\n" +
                "1366\n" +
                "1367\n" +
                "1373\n" +
                "1379\n" +
                "1380\n" +
                "1383\n" +
                "1401\n" +
                "1402\n" +
                "1413\n" +
                "1415\n" +
                "1419\n" +
                "1425\n" +
                "1431\n" +
                "1434\n" +
                "1437\n" +
                "1438\n" +
                "1441\n" +
                "1456\n" +
                "1461\n" +
                "1462\n" +
                "1464\n" +
                "1467\n" +
                "1474\n" +
                "1477\n" +
                "1478\n" +
                "1481\n" +
                "1495\n" +
                "1499\n" +
                "1503\n" +
                "1505\n" +
                "1512\n" +
                "1513\n" +
                "1514\n" +
                "1515\n" +
                "1530\n" +
                "1532\n" +
                "1535\n" +
                "1538\n" +
                "1560\n" +
                "1565\n" +
                "1566\n" +
                "1568\n" +
                "1572\n" +
                "1575\n" +
                "1585\n" +
                "1588\n" +
                "1591\n" +
                "1597\n" +
                "1600\n" +
                "1601\n" +
                "1607\n" +
                "1609\n" +
                "1612\n" +
                "1617\n" +
                "1619\n" +
                "1626\n" +
                "1627\n" +
                "1631\n" +
                "1632\n" +
                "1635\n" +
                "1637\n" +
                "1638\n" +
                "1643\n" +
                "1644\n" +
                "1645\n" +
                "1650\n" +
                "1651\n" +
                "1655\n" +
                "1664\n" +
                "1669\n" +
                "1673\n" +
                "1681\n" +
                "1686\n" +
                "1688\n" +
                "1694\n" +
                "1708\n" +
                "1711\n" +
                "1717\n" +
                "1725\n" +
                "1728\n" +
                "1740\n" +
                "1751\n" +
                "1752\n" +
                "1755\n" +
                "1758\n" +
                "1759\n" +
                "1761\n" +
                "1763\n" +
                "1765\n" +
                "1766\n" +
                "1767\n" +
                "1768\n" +
                "1771\n" +
                "1772\n" +
                "1773\n" +
                "1775\n" +
                "1784\n" +
                "1789\n" +
                "1791\n" +
                "1792\n" +
                "1794\n" +
                "1797\n" +
                "1798\n" +
                "1810\n" +
                "1819\n" +
                "1821\n" +
                "1826\n" +
                "1831\n" +
                "1833\n" +
                "1834\n" +
                "1835\n" +
                "1838\n" +
                "1839\n" +
                "1858\n" +
                "1859\n" +
                "1862\n" +
                "1864\n" +
                "1867\n" +
                "1869\n" +
                "1873\n" +
                "1878\n" +
                "1882\n" +
                "1888\n" +
                "1890\n" +
                "1896\n" +
                "1908\n" +
                "1909\n" +
                "1920\n" +
                "1930\n" +
                "1937\n" +
                "1938\n" +
                "1941\n" +
                "1942\n" +
                "1946\n" +
                "1950\n" +
                "1964\n" +
                "1966\n" +
                "1978\n" +
                "1982\n" +
                "1987\n" +
                "1989\n" +
                "1996\n" +
                "1997\n" +
                "1998\n" +
                "1999\n";

        List list=new ArrayList();
        for (int i = 0; i < 2900; i++)
            list.add(i+1);
        Collections.shuffle(list);

        Random ra =new Random();

        String[] strings = string.split("\n");
        int[] numbers = new int[500];
        //461
        System.out.println(strings.length);
         for (int i=0;i<strings.length;i++) {
            numbers[i] = Integer.parseInt(strings[i]);
         }
         for (int i=0;i<strings.length;i++) {

             int tt = ra.nextInt(10) + 5
                     ;
             int houNum = Integer.parseInt(list.get(i).toString());

             System.out.println("INSERT INTO new_database.dbo.tb_rental_table " +
                     "(rental_number, tenant_number, rental_house_number, rental_period) " +
                     "VALUES (" + i + ", " + numbers[i] + ", " + houNum + ", " + tt + ");");
         }
    }

    public void getUpdateData() {
        String string = "1\t11\t2018-10-23\n" +
                "2\t10\t2013-11-21\n" +
                "3\t8\t2015-04-16\n" +
                "4\t12\t2015-01-06\n" +
                "5\t6\t2016-06-07\n" +
                "6\t9\t2013-11-24\n" +
                "7\t14\t2016-11-03\n" +
                "8\t12\t2013-02-15\n" +
                "9\t13\t2015-05-19\n" +
                "10\t9\t2014-12-17\n" +
                "11\t6\t2013-10-10\n" +
                "12\t6\t2016-08-01\n" +
                "13\t5\t2017-09-23\n" +
                "14\t5\t2015-02-24\n" +
                "15\t13\t2014-06-15\n" +
                "16\t6\t2017-04-24\n" +
                "17\t13\t2014-07-16\n" +
                "18\t5\t2013-04-28\n" +
                "19\t10\t2017-01-16\n" +
                "20\t11\t2017-08-13\n" +
                "21\t13\t2015-05-10\n" +
                "22\t7\t2016-08-09\n" +
                "23\t10\t2016-10-07\n" +
                "24\t6\t2017-04-10\n" +
                "25\t8\t2015-05-16\n" +
                "26\t8\t2013-10-23\n" +
                "27\t6\t2013-11-08\n" +
                "28\t8\t2016-08-22\n" +
                "29\t6\t2014-05-11\n" +
                "30\t11\t2014-01-05\n" +
                "31\t14\t2015-02-24\n" +
                "32\t6\t2017-05-08\n" +
                "33\t11\t2014-10-09\n" +
                "34\t11\t2014-12-10\n" +
                "35\t11\t2016-08-12\n" +
                "36\t5\t2014-11-11\n" +
                "37\t5\t2017-09-09\n" +
                "38\t14\t2016-08-04\n" +
                "39\t7\t2015-01-27\n" +
                "40\t12\t2015-04-03\n" +
                "41\t10\t2017-09-02\n" +
                "42\t13\t2015-07-10\n" +
                "43\t12\t2017-12-10\n" +
                "44\t7\t2016-11-03\n" +
                "45\t6\t2016-03-13\n" +
                "46\t13\t2013-01-12\n" +
                "47\t8\t2013-09-18\n" +
                "48\t13\t2017-11-10\n" +
                "49\t9\t2016-08-23\n" +
                "50\t12\t2013-11-06\n" +
                "51\t5\t2013-03-09\n" +
                "52\t12\t2013-03-28\n" +
                "53\t13\t2014-04-12\n" +
                "54\t7\t2014-10-07\n" +
                "55\t10\t2013-08-09\n" +
                "56\t8\t2014-12-18\n" +
                "57\t6\t2017-09-02\n" +
                "58\t7\t2017-05-28\n" +
                "59\t14\t2014-03-27\n" +
                "60\t10\t2016-01-26\n" +
                "61\t10\t2017-07-02\n" +
                "62\t9\t2017-11-09\n" +
                "63\t7\t2016-11-19\n" +
                "64\t6\t2017-11-25\n" +
                "65\t8\t2016-11-14\n" +
                "66\t7\t2014-11-08\n" +
                "67\t13\t2015-06-09\n" +
                "68\t7\t2015-02-11\n" +
                "69\t8\t2014-07-09\n" +
                "70\t11\t2017-10-21\n" +
                "71\t11\t2017-01-03\n" +
                "72\t10\t2015-04-02\n" +
                "73\t12\t2016-04-11\n" +
                "74\t10\t2013-09-02\n" +
                "75\t6\t2014-01-22\n" +
                "76\t13\t2014-05-04\n" +
                "77\t7\t2016-03-28\n" +
                "78\t7\t2017-12-27\n" +
                "79\t11\t2013-12-12\n" +
                "80\t12\t2013-03-14\n" +
                "81\t7\t2016-07-28\n" +
                "82\t11\t2017-07-04\n" +
                "83\t6\t2016-09-13\n" +
                "84\t10\t2014-05-16\n" +
                "85\t7\t2014-08-21\n" +
                "86\t12\t2016-07-14\n" +
                "87\t12\t2015-01-19\n" +
                "88\t7\t2016-07-14\n" +
                "89\t8\t2014-06-10\n" +
                "90\t11\t2015-04-27\n" +
                "91\t8\t2015-10-22\n" +
                "92\t6\t2017-04-11\n" +
                "93\t5\t2015-01-12\n" +
                "94\t12\t2017-10-06\n" +
                "95\t12\t2017-11-04\n" +
                "96\t8\t2013-09-14\n" +
                "97\t6\t2014-12-23\n" +
                "98\t6\t2014-10-03\n" +
                "99\t9\t2014-11-06\n" +
                "100\t12\t2013-05-11\n" +
                "101\t10\t2014-12-06\n" +
                "102\t6\t2017-01-10\n" +
                "103\t10\t2015-04-13\n" +
                "104\t14\t2014-10-07\n" +
                "105\t8\t2013-10-20\n" +
                "106\t7\t2016-04-11\n" +
                "107\t12\t2014-02-28\n" +
                "108\t5\t2015-04-15\n" +
                "109\t10\t2013-10-28\n" +
                "110\t13\t2013-07-05\n" +
                "111\t14\t2014-04-20\n" +
                "112\t5\t2016-09-03\n" +
                "113\t6\t2014-08-07\n" +
                "114\t8\t2017-11-03\n" +
                "115\t14\t2014-07-26\n" +
                "116\t11\t2014-09-07\n" +
                "117\t5\t2016-06-01\n" +
                "118\t11\t2015-06-16\n" +
                "119\t14\t2014-07-08\n" +
                "120\t14\t2017-07-20\n" +
                "121\t7\t2015-08-02\n" +
                "122\t11\t2015-03-24\n" +
                "123\t8\t2015-05-10\n" +
                "124\t5\t2014-09-24\n" +
                "125\t13\t2013-11-05\n" +
                "126\t5\t2017-11-17\n" +
                "127\t14\t2014-02-08\n" +
                "128\t10\t2016-01-08\n" +
                "129\t8\t2015-08-19\n" +
                "130\t5\t2016-12-15\n" +
                "131\t12\t2015-10-22\n" +
                "132\t8\t2015-10-11\n" +
                "133\t8\t2014-05-17\n" +
                "134\t5\t2016-04-19\n" +
                "135\t7\t2015-08-16\n" +
                "136\t7\t2013-02-28\n" +
                "137\t9\t2014-11-23\n" +
                "138\t5\t2015-01-19\n" +
                "139\t9\t2015-06-14\n" +
                "140\t11\t2017-02-09\n" +
                "141\t7\t2013-11-28\n" +
                "142\t6\t2016-01-23\n" +
                "143\t9\t2015-05-03\n" +
                "144\t14\t2014-11-11\n" +
                "145\t13\t2017-07-09\n" +
                "146\t5\t2014-05-02\n" +
                "147\t12\t2015-06-25\n" +
                "148\t10\t2017-04-19\n" +
                "149\t9\t2013-01-10\n" +
                "150\t7\t2014-08-16\n" +
                "151\t6\t2013-01-12\n" +
                "152\t12\t2014-11-27\n" +
                "153\t13\t2016-02-16\n" +
                "154\t8\t2013-02-15\n" +
                "155\t8\t2017-12-20\n" +
                "156\t13\t2014-12-21\n" +
                "157\t14\t2016-02-16\n" +
                "158\t12\t2017-05-01\n" +
                "159\t7\t2016-09-18\n" +
                "160\t6\t2013-01-21\n" +
                "161\t11\t2014-04-08\n" +
                "162\t9\t2015-08-20\n" +
                "163\t9\t2015-04-11\n" +
                "164\t14\t2016-10-22\n" +
                "165\t11\t2013-09-25\n" +
                "166\t5\t2015-07-01\n" +
                "167\t13\t2016-06-05\n" +
                "168\t7\t2015-01-16\n" +
                "169\t11\t2015-02-14\n" +
                "170\t14\t2015-05-11\n" +
                "171\t9\t2013-03-26\n" +
                "172\t7\t2017-04-13\n" +
                "173\t5\t2017-06-25\n" +
                "174\t10\t2014-02-28\n" +
                "175\t13\t2015-04-07\n" +
                "176\t7\t2013-11-09\n" +
                "177\t14\t2015-08-20\n" +
                "178\t9\t2014-03-19\n" +
                "179\t6\t2014-06-21\n" +
                "180\t5\t2015-10-28\n" +
                "181\t13\t2014-09-18\n" +
                "182\t12\t2017-08-02\n" +
                "183\t14\t2013-07-24\n" +
                "184\t5\t2013-03-02\n" +
                "185\t14\t2016-02-27\n" +
                "186\t12\t2015-08-15\n" +
                "187\t13\t2015-02-06\n" +
                "188\t5\t2014-12-16\n" +
                "189\t11\t2017-09-25\n" +
                "190\t9\t2013-09-10\n" +
                "191\t5\t2016-02-03\n" +
                "192\t10\t2014-08-02\n" +
                "193\t12\t2017-08-22\n" +
                "194\t7\t2017-04-13\n" +
                "195\t5\t2013-12-15\n" +
                "196\t11\t2017-08-16\n" +
                "197\t8\t2017-01-04\n" +
                "198\t8\t2015-11-07\n" +
                "199\t11\t2015-11-23\n" +
                "200\t9\t2015-01-14\n" +
                "201\t5\t2015-09-24\n" +
                "202\t6\t2015-06-15\n" +
                "203\t12\t2017-01-21\n" +
                "204\t8\t2016-05-24\n" +
                "205\t12\t2015-04-02\n" +
                "206\t5\t2016-03-17\n" +
                "207\t13\t2013-07-19\n" +
                "208\t8\t2014-04-25\n" +
                "209\t14\t2014-06-02\n" +
                "210\t8\t2017-07-28\n" +
                "211\t8\t2016-10-24\n" +
                "212\t6\t2016-06-07\n" +
                "213\t11\t2014-03-17\n" +
                "214\t12\t2016-10-14\n" +
                "215\t6\t2013-01-12\n" +
                "216\t6\t2013-03-15\n" +
                "217\t14\t2015-02-19\n" +
                "218\t10\t2014-07-10\n" +
                "219\t5\t2014-08-25\n" +
                "220\t8\t2017-01-22\n" +
                "221\t8\t2016-12-18\n" +
                "222\t8\t2016-05-16\n" +
                "223\t6\t2015-10-02\n" +
                "224\t12\t2015-10-16\n" +
                "225\t5\t2015-08-15\n" +
                "226\t10\t2016-02-23\n" +
                "227\t6\t2015-03-03\n" +
                "228\t12\t2016-06-18\n" +
                "229\t13\t2013-11-24\n" +
                "230\t5\t2014-07-01\n" +
                "231\t11\t2017-05-23\n" +
                "232\t7\t2015-04-04\n" +
                "233\t10\t2017-10-09\n" +
                "234\t6\t2013-05-07\n" +
                "235\t6\t2015-01-19\n" +
                "236\t6\t2014-02-01\n" +
                "237\t9\t2015-12-05\n" +
                "238\t8\t2014-11-08\n" +
                "239\t9\t2013-03-24\n" +
                "240\t11\t2015-02-11\n" +
                "241\t8\t2017-02-26\n" +
                "242\t13\t2014-03-15\n" +
                "243\t6\t2014-03-09\n" +
                "244\t10\t2017-01-15\n" +
                "245\t6\t2016-02-12\n" +
                "246\t12\t2014-03-09\n" +
                "247\t13\t2016-03-22\n" +
                "248\t12\t2015-11-05\n" +
                "249\t14\t2013-03-01\n" +
                "250\t5\t2016-05-14\n" +
                "251\t10\t2015-09-21\n" +
                "252\t11\t2015-05-13\n" +
                "253\t11\t2016-03-09\n" +
                "254\t10\t2016-08-08\n" +
                "255\t13\t2016-06-27\n" +
                "256\t14\t2015-03-21\n" +
                "257\t7\t2016-08-28\n" +
                "258\t10\t2017-07-26\n" +
                "259\t7\t2013-09-03\n" +
                "260\t7\t2014-08-28\n" +
                "261\t13\t2013-09-25\n" +
                "262\t12\t2015-11-07\n" +
                "263\t11\t2013-02-12\n" +
                "264\t11\t2017-01-09\n" +
                "265\t5\t2017-09-14\n" +
                "266\t13\t2013-02-10\n" +
                "267\t10\t2016-03-24\n" +
                "268\t14\t2015-11-05\n" +
                "269\t7\t2015-06-19\n" +
                "270\t14\t2013-10-19\n" +
                "271\t9\t2017-09-13\n" +
                "272\t12\t2016-01-11\n" +
                "273\t5\t2017-04-04\n" +
                "274\t9\t2016-04-04\n" +
                "275\t13\t2015-04-19\n" +
                "276\t14\t2013-06-09\n" +
                "277\t8\t2015-06-11\n" +
                "278\t8\t2013-10-06\n" +
                "279\t6\t2015-01-12\n" +
                "280\t9\t2016-03-28\n" +
                "281\t14\t2013-09-03\n" +
                "282\t7\t2014-03-04\n" +
                "283\t14\t2015-06-10\n" +
                "284\t11\t2016-06-01\n" +
                "285\t14\t2013-07-02\n" +
                "286\t10\t2013-07-01\n" +
                "287\t7\t2014-04-19\n" +
                "288\t10\t2015-11-19\n" +
                "289\t8\t2017-11-14\n" +
                "290\t14\t2015-08-09\n" +
                "291\t5\t2016-01-23\n" +
                "292\t11\t2016-04-21\n" +
                "293\t8\t2014-07-16\n" +
                "294\t11\t2016-04-10\n" +
                "295\t13\t2015-08-26\n" +
                "296\t5\t2015-08-25\n" +
                "297\t9\t2017-04-25\n" +
                "298\t7\t2016-08-25\n" +
                "299\t9\t2015-06-12\n" +
                "300\t6\t2015-11-08\n" +
                "301\t13\t2016-06-03\n" +
                "302\t9\t2015-05-01\n" +
                "303\t11\t2017-07-15\n" +
                "304\t7\t2017-06-05\n" +
                "305\t14\t2016-04-12\n" +
                "306\t12\t2017-07-13\n" +
                "307\t13\t2013-06-16\n" +
                "308\t13\t2017-10-28\n" +
                "309\t5\t2017-11-02\n" +
                "310\t12\t2013-12-17\n" +
                "311\t5\t2017-11-14\n" +
                "312\t11\t2017-12-16\n" +
                "313\t7\t2016-11-27\n" +
                "314\t10\t2015-02-19\n" +
                "315\t13\t2014-10-08\n" +
                "316\t11\t2017-09-13\n" +
                "317\t11\t2014-07-23\n" +
                "318\t12\t2014-04-23\n" +
                "319\t9\t2015-01-18\n" +
                "320\t8\t2015-03-04\n" +
                "321\t8\t2015-06-20\n" +
                "322\t8\t2013-11-18\n" +
                "323\t6\t2016-11-27\n" +
                "324\t12\t2017-08-14\n" +
                "325\t10\t2016-11-01\n" +
                "326\t7\t2015-02-09\n" +
                "327\t10\t2014-09-22\n" +
                "328\t5\t2015-09-04\n" +
                "329\t10\t2017-09-08\n" +
                "330\t11\t2015-05-24\n" +
                "331\t10\t2016-06-03\n" +
                "332\t11\t2017-07-09\n" +
                "333\t6\t2015-09-23\n" +
                "334\t5\t2016-11-15\n" +
                "335\t5\t2014-07-25\n" +
                "336\t7\t2014-11-21\n" +
                "337\t7\t2014-09-22\n" +
                "338\t5\t2017-10-08\n" +
                "339\t6\t2017-12-10\n" +
                "340\t14\t2017-05-17\n" +
                "341\t5\t2016-06-24\n" +
                "342\t12\t2016-12-11\n" +
                "343\t8\t2017-05-27\n" +
                "344\t14\t2017-01-09\n" +
                "345\t6\t2016-10-23\n" +
                "346\t11\t2015-08-21\n" +
                "347\t11\t2016-06-03\n" +
                "348\t12\t2015-05-26\n" +
                "349\t8\t2015-11-26\n" +
                "350\t7\t2013-11-23\n" +
                "351\t7\t2017-06-26\n" +
                "352\t8\t2015-05-18\n" +
                "353\t6\t2013-09-02\n" +
                "354\t11\t2016-05-19\n" +
                "355\t11\t2014-04-07\n" +
                "356\t5\t2013-04-06\n" +
                "357\t9\t2014-11-24\n" +
                "358\t5\t2014-03-12\n" +
                "359\t11\t2016-04-19\n" +
                "360\t7\t2016-04-02\n" +
                "361\t9\t2013-10-10\n" +
                "362\t9\t2017-12-27\n" +
                "363\t11\t2017-12-21\n" +
                "364\t5\t2017-11-08\n" +
                "365\t12\t2017-06-24\n" +
                "366\t5\t2015-01-19\n" +
                "367\t8\t2016-11-03\n" +
                "368\t9\t2014-06-03\n" +
                "369\t9\t2015-12-11\n" +
                "370\t14\t2016-10-22\n" +
                "371\t13\t2017-03-03\n" +
                "372\t9\t2016-03-04\n" +
                "373\t14\t2015-06-06\n" +
                "374\t6\t2017-10-11\n" +
                "375\t11\t2014-03-07\n" +
                "376\t10\t2014-10-26\n" +
                "377\t6\t2017-10-25\n" +
                "378\t11\t2013-06-28\n" +
                "379\t8\t2017-01-06\n" +
                "380\t6\t2015-03-03\n" +
                "381\t14\t2013-04-07\n" +
                "382\t9\t2016-07-12\n" +
                "383\t9\t2013-05-13\n" +
                "384\t13\t2016-03-07\n" +
                "385\t7\t2016-03-24\n" +
                "386\t12\t2014-02-13\n" +
                "387\t13\t2013-04-07\n" +
                "388\t6\t2013-02-06\n" +
                "389\t9\t2016-10-04\n" +
                "390\t5\t2016-01-04\n" +
                "391\t9\t2013-04-18\n" +
                "392\t11\t2017-10-07\n" +
                "393\t10\t2016-08-19\n" +
                "394\t8\t2014-04-06\n" +
                "395\t11\t2014-04-25\n" +
                "396\t7\t2015-06-26\n" +
                "397\t10\t2017-09-17\n" +
                "398\t7\t2013-10-23\n" +
                "399\t9\t2014-09-18\n" +
                "400\t5\t2013-10-03\n" +
                "401\t11\t2014-09-10\n" +
                "402\t8\t2017-10-15\n" +
                "403\t7\t2015-06-21\n" +
                "404\t5\t2014-07-12\n" +
                "405\t10\t2017-11-27\n" +
                "406\t8\t2016-07-05\n" +
                "407\t6\t2013-06-03\n" +
                "408\t10\t2016-11-17\n" +
                "409\t5\t2015-03-16\n" +
                "410\t14\t2017-08-05\n" +
                "411\t6\t2016-04-19\n" +
                "412\t9\t2014-11-13\n" +
                "413\t7\t2013-01-16\n" +
                "414\t14\t2015-08-22\n" +
                "415\t11\t2013-08-27\n" +
                "416\t9\t2014-08-09\n" +
                "417\t7\t2017-02-06\n" +
                "418\t13\t2013-01-08\n" +
                "419\t8\t2017-02-02\n" +
                "420\t14\t2017-12-01\n" +
                "421\t11\t2013-08-22\n" +
                "422\t7\t2015-04-03\n" +
                "423\t14\t2017-03-18\n" +
                "424\t10\t2017-05-18\n" +
                "425\t9\t2013-02-11\n" +
                "426\t9\t2016-03-24\n" +
                "427\t9\t2016-01-01\n" +
                "428\t8\t2013-09-11\n" +
                "429\t14\t2014-11-08\n" +
                "430\t11\t2016-10-23\n" +
                "431\t5\t2016-03-09\n" +
                "432\t6\t2013-07-05\n" +
                "433\t8\t2017-12-22\n" +
                "434\t5\t2015-04-11\n" +
                "435\t5\t2016-10-05\n" +
                "436\t8\t2013-06-18\n" +
                "437\t10\t2014-09-21\n" +
                "438\t8\t2017-06-02\n" +
                "439\t14\t2017-04-26\n" +
                "440\t11\t2015-04-21\n" +
                "441\t14\t2016-05-09\n" +
                "442\t7\t2016-06-03\n" +
                "443\t7\t2015-06-24\n" +
                "444\t6\t2017-12-15\n" +
                "445\t11\t2013-10-27\n" +
                "446\t11\t2013-07-13\n" +
                "447\t10\t2014-10-03\n" +
                "448\t5\t2014-08-23\n" +
                "449\t5\t2014-04-28\n" +
                "450\t7\t2017-04-11\n" +
                "451\t5\t2015-11-06\n" +
                "452\t14\t2013-10-28\n" +
                "453\t11\t2016-10-01\n" +
                "454\t6\t2015-03-24\n" +
                "455\t12\t2016-08-23\n" +
                "456\t6\t2014-03-13\n" +
                "457\t10\t2015-03-10\n" +
                "458\t10\t2014-11-18\n" +
                "459\t9\t2014-08-11\n" +
                "460\t7\t2017-08-18\n";

        String[] strings = string.split("\n");
        int longth = strings.length;
        System.out.println(longth);
        for (int i=0;i<460;i++) {
            String[] datas = strings[i].split("\t");
            String id = datas[0];
            int time = Integer.parseInt(datas[1]);
            String[] dates = datas[2].split("-");
            int y = Integer.parseInt(dates[0]);
            int m = Integer.parseInt(dates[1]);
            int d = Integer.parseInt(dates[2]);

            //获取租房时间
            m = m + 3;
            if (m > 12) {
                int j = m/12;
                m = m%12;
                if (m == 0) {
                    m = 1;
                }
                y = y + j;
            }
            String newDateI = y + "-" + m + "-" + d;

            //获取到期时间
            m = m + time;
            if (m > 12) {
                int j = m/12;
                m = m%12;
                if (m == 0) {
                    m = 1;
                }
                y = y + j;
            }
            String newDateII = y + "-" + m + "-" + d;

            System.out.println("UPDATE new_database.dbo.tb_rental_table SET " +
                    "new_database.dbo.tb_rental_table.rental_time = \'" + newDateI + "\', " +
                    "new_database.dbo.tb_rental_table.expiry_time = \'" + newDateII + "\' WHERE " +
                    "new_database.dbo.tb_rental_table.rental_number = " + i + ";");

        }

    }

    public void setBool() {
        String string = "1022\n" +
                "580\n" +
                "2048\n" +
                "780\n" +
                "2779\n" +
                "1327\n" +
                "1230\n" +
                "58\n" +
                "2455\n" +
                "855\n" +
                "107\n" +
                "1417\n" +
                "158\n" +
                "711\n" +
                "2687\n" +
                "1129\n" +
                "894\n" +
                "724\n" +
                "2606\n" +
                "1235\n" +
                "1723\n" +
                "1281\n" +
                "2857\n" +
                "1686\n" +
                "886\n" +
                "379\n" +
                "2486\n" +
                "2650\n" +
                "263\n" +
                "244\n" +
                "2843\n" +
                "1295\n" +
                "90\n" +
                "694\n" +
                "1314\n" +
                "954\n" +
                "2713\n" +
                "1975\n" +
                "2177\n" +
                "2743\n" +
                "570\n" +
                "500\n" +
                "1540\n" +
                "2503\n" +
                "1237\n" +
                "243\n" +
                "2885\n" +
                "1572\n" +
                "2492\n" +
                "1083\n" +
                "1561\n" +
                "86\n" +
                "1712\n" +
                "1260\n" +
                "1067\n" +
                "668\n" +
                "813\n" +
                "844\n" +
                "980\n" +
                "1247\n" +
                "1143\n" +
                "157\n" +
                "1145\n" +
                "2749\n" +
                "1534\n" +
                "2553\n" +
                "663\n" +
                "27\n" +
                "50\n" +
                "2680\n" +
                "2796\n" +
                "1410\n" +
                "1871\n" +
                "656\n" +
                "2285\n" +
                "1133\n" +
                "1128\n" +
                "2479\n" +
                "2117\n" +
                "2073\n" +
                "1580\n" +
                "1481\n" +
                "631\n" +
                "2362\n" +
                "2871\n" +
                "65\n" +
                "635\n" +
                "1381\n" +
                "2115\n" +
                "1254\n" +
                "91\n" +
                "2078\n" +
                "2365\n" +
                "528\n" +
                "610\n" +
                "1331\n" +
                "490\n" +
                "2364\n" +
                "1213\n" +
                "2413\n" +
                "1765\n" +
                "2522\n" +
                "1414\n" +
                "2425\n" +
                "1859\n" +
                "1059\n" +
                "1993\n" +
                "1523\n" +
                "1004\n" +
                "2868\n" +
                "2554\n" +
                "1850\n" +
                "550\n" +
                "108\n" +
                "2133\n" +
                "2582\n" +
                "2249\n" +
                "2658\n" +
                "1001\n" +
                "2164\n" +
                "1560\n" +
                "1595\n" +
                "376\n" +
                "1976\n" +
                "1505\n" +
                "2646\n" +
                "2153\n" +
                "2394\n" +
                "925\n" +
                "861\n" +
                "2027\n" +
                "2519\n" +
                "2598\n" +
                "507\n" +
                "2797\n" +
                "1474\n" +
                "438\n" +
                "2042\n" +
                "421\n" +
                "2488\n" +
                "2212\n" +
                "1284\n" +
                "985\n" +
                "1511\n" +
                "2831\n" +
                "133\n" +
                "927\n" +
                "1364\n" +
                "2157\n" +
                "1153\n" +
                "2837\n" +
                "1706\n" +
                "751\n" +
                "420\n" +
                "2330\n" +
                "1661\n" +
                "715\n" +
                "639\n" +
                "2616\n" +
                "2434\n" +
                "1573\n" +
                "1902\n" +
                "1937\n" +
                "96\n" +
                "548\n" +
                "2071\n" +
                "2542\n" +
                "889\n" +
                "290\n" +
                "396\n" +
                "2291\n" +
                "245\n" +
                "1034\n" +
                "1366\n" +
                "2744\n" +
                "2093\n" +
                "2509\n" +
                "97\n" +
                "322\n" +
                "2642\n" +
                "943\n" +
                "681\n" +
                "465\n" +
                "869\n" +
                "2739\n" +
                "2838\n" +
                "1274\n" +
                "2014\n" +
                "2033\n" +
                "1271\n" +
                "1041\n" +
                "1294\n" +
                "2235\n" +
                "2679\n" +
                "1635\n" +
                "1309\n" +
                "1831\n" +
                "4\n" +
                "2106\n" +
                "1538\n" +
                "155\n" +
                "21\n" +
                "1539\n" +
                "77\n" +
                "705\n" +
                "633\n" +
                "250\n" +
                "915\n" +
                "1529\n" +
                "301\n" +
                "461\n" +
                "433\n" +
                "1184\n" +
                "1720\n" +
                "1484\n" +
                "1797\n" +
                "1024\n" +
                "236\n" +
                "2054\n" +
                "1931\n" +
                "2329\n" +
                "2100\n" +
                "111\n" +
                "329\n" +
                "1912\n" +
                "1865\n" +
                "1978\n" +
                "1758\n" +
                "2810\n" +
                "2380\n" +
                "2502\n" +
                "2114\n" +
                "2435\n" +
                "2897\n" +
                "973\n" +
                "1204\n" +
                "1445\n" +
                "1296\n" +
                "535\n" +
                "2037\n" +
                "2580\n" +
                "1925\n" +
                "1057\n" +
                "1412\n" +
                "160\n" +
                "1943\n" +
                "2112\n" +
                "1707\n" +
                "2194\n" +
                "1132\n" +
                "2620\n" +
                "2592\n" +
                "36\n" +
                "1002\n" +
                "1886\n" +
                "629\n" +
                "1682\n" +
                "912\n" +
                "693\n" +
                "721\n" +
                "2841\n" +
                "257\n" +
                "2740\n" +
                "2878\n" +
                "2677\n" +
                "1788\n" +
                "1696\n" +
                "1549\n" +
                "2577\n" +
                "708\n" +
                "2574\n" +
                "875\n" +
                "1130\n" +
                "1702\n" +
                "1632\n" +
                "1954\n" +
                "182\n" +
                "1033\n" +
                "937\n" +
                "1124\n" +
                "1178\n" +
                "1111\n" +
                "778\n" +
                "652\n" +
                "796\n" +
                "671\n" +
                "2750\n" +
                "709\n" +
                "1074\n" +
                "748\n" +
                "699\n" +
                "1772\n" +
                "1035\n" +
                "494\n" +
                "782\n" +
                "1073\n" +
                "936\n" +
                "2446\n" +
                "1855\n" +
                "1192\n" +
                "1195\n" +
                "1884\n" +
                "835\n" +
                "1940\n" +
                "378\n" +
                "2277\n" +
                "2846\n" +
                "557\n" +
                "2767\n" +
                "2662\n" +
                "346\n" +
                "1996\n" +
                "561\n" +
                "269\n" +
                "1379\n" +
                "1487\n" +
                "2800\n" +
                "1845\n" +
                "1817\n" +
                "1056\n" +
                "350\n" +
                "1999\n" +
                "632\n" +
                "1755\n" +
                "1735\n" +
                "390\n" +
                "1228\n" +
                "621\n" +
                "1483\n" +
                "2585\n" +
                "2546\n" +
                "2506\n" +
                "2427\n" +
                "501\n" +
                "1781\n" +
                "1440\n" +
                "2182\n" +
                "2699\n" +
                "1532\n" +
                "677\n" +
                "2286\n" +
                "1119\n" +
                "799\n" +
                "166\n" +
                "1962\n" +
                "572\n" +
                "2836\n" +
                "1607\n" +
                "2057\n" +
                "1885\n" +
                "2816\n" +
                "2280\n" +
                "2239\n" +
                "161\n" +
                "719\n" +
                "2262\n" +
                "2890\n" +
                "286\n" +
                "1459\n" +
                "1874\n" +
                "2790\n" +
                "1796\n" +
                "1987\n" +
                "868\n" +
                "1601\n" +
                "2532\n" +
                "1043\n" +
                "2720\n" +
                "682\n" +
                "2715\n" +
                "2053\n" +
                "2876\n" +
                "310\n" +
                "1238\n" +
                "296\n" +
                "1678\n" +
                "125\n" +
                "1642\n" +
                "1311\n" +
                "335\n" +
                "1606\n" +
                "1717\n" +
                "1283\n" +
                "2788\n" +
                "612\n" +
                "375\n" +
                "1602\n" +
                "578\n" +
                "1324\n" +
                "924\n" +
                "1389\n" +
                "320\n" +
                "2826\n" +
                "1650\n" +
                "2569\n" +
                "1400\n" +
                "1777\n" +
                "1546\n" +
                "1147\n" +
                "540\n" +
                "249\n" +
                "531\n" +
                "720\n" +
                "1466\n" +
                "2631\n" +
                "2401\n" +
                "666\n" +
                "2705\n" +
                "823\n" +
                "212\n" +
                "961\n" +
                "2084\n" +
                "2456\n" +
                "904\n" +
                "272\n" +
                "2640\n" +
                "1983\n" +
                "2253\n" +
                "944\n" +
                "455\n" +
                "1094\n" +
                "1045\n" +
                "2301\n" +
                "447\n" +
                "2748\n" +
                "1909\n" +
                "1721\n" +
                "371\n" +
                "2588\n" +
                "978\n" +
                "1934\n" +
                "642\n" +
                "1854\n" +
                "1008\n" +
                "1941\n" +
                "2352\n" +
                "1265\n" +
                "872\n" +
                "1144\n" +
                "262\n" +
                "321\n" +
                "1480\n" +
                "117\n" +
                "856\n" +
                "427\n" +
                "476\n" +
                "2158\n" +
                "1554\n" +
                "1121\n" +
                "779\n" +
                "426\n" +
                "822\n" +
                "994\n" +
                "1341\n" +
                "175\n" +
                "1543\n" +
                "348\n" +
                "1061\n" +
                "809\n" +
                "2776\n" +
                "1346\n";
        String[] strings = string.split("\n");
        for (int i=0;i<strings.length;i++) {
            System.out.println("UPDATE new_database.dbo.tb_rental_housing_table " +
                    "SET new_database.dbo.tb_rental_housing_table.rented_it = 1 " +
                    "WHERE new_database.dbo.tb_rental_housing_table.rental_house_number = " + strings[i] + ";");
        }
    }

    public static void main(String[] args) {
        System.out.println("aaaaa".hashCode());
        //new DD().setBool();
    }
}
